package com.lemeng.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.lemeng.service.StockBackService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class MyStockBackTask {

    @Reference
    StockBackService stockBackService;

    //@Scheduled(cron = "0 0 0/1 * * ?")
    @Scheduled(cron = "0/10 * * * * ?")
    public void doBack(){
        System.out.println("开始执行回滚");
        stockBackService.doBack();
        System.out.println("回滚结束");
    }
}
